import service from "@/service/http.interceptor";

/**
 * 获取领取优惠券列表
 */
export const getCouponList = (params) => {
	return service.request({
		method: 'get',
		url: 'shop_user/coupon/c/getCouponList',
		params,
		custom: {
			loading: true
		}
	})	
}

/**
 * 根据用户获取领取优惠券列表
 */
export const getCouponListByUserId = (params) => {
	return service.request({
		method: 'get',
		url: 'shop_user/coupon/c/getCouponListByUserId',
		params,
		custom: {
			loading: true
		}
	})	
}


/**
 * 领取优惠券
 */
export const obtainCoupon = (data) => {
	return service.request({
		method: 'post',
		url: 'shop_user/coupon/c/obtain',
		data,
		custom: {
			loading: true
		}
	})	
}

/**
 * 获取用户可用的优惠券
 */
export const getAvailableCoupon = (params) => {
	return service.request({
		method: 'get',
		url: 'shop_user/coupon/c/getAvailableCoupon',
		params,
		custom: {
			loading: true
		}
	})	
}


/**
 * 获取用户优惠券
 */
export const getMyCoupon = (params) => {
	return service.request({
		method: 'get',
		url: 'shop_user/coupon/c/getMyCoupon',
		params,
		custom: {
			loading: true
		}
	})	
}